<div class="content-wrapper">
	<section class="content-header">
		<h1>
			【{$userInfo.name}】的所有权限
			<small>已开通的功能使用<span style='color: red;'>红色</span>标识</small>
		</h1>
		<ol class="breadcrumb">
			<li><a href="/admin"><i class="fa fa-dashboard"></i> 首页</a></li>
			<li class="active">账号管理</li>
			<li class="active"><a href="/admin/user/userList">用户列表</a></li>
			<li class="active">用户权限列表</li>
		</ol>
	</section>
	<section class="content">
		<div class="box">
			<div class="box-header with-border">				
			</div>
			<div class="box-body">
				<table class="table table-bordered">                            
                    <tbody>
                    	<foreach name="functionGroupList" item="functionGroup">
                    		<tr>
                    			<td>
                    				<div id="groupsids_{$functionGroup.id}" class="accordion-group">
                    					<label  style="width:250px;" class="position-relative">
                    						<span class="lbl" title="{$functionGroup.name}">
                    							<b>{$functionGroup.name}</b>
                    						</span>
                    					</label>
                    				</div>
                    				<div id="fun_ids_{$functionGroup.id}" class="accordion-inner" style="padding:9px 15px 9px 30px;">
                    					<foreach name="functionGroup.functionList" item="function">
                    						<label  style="width:250px;" class="position-relative">
                    							<input type="checkbox" class="ace" name="func_ids[]" value="{$function.id}" <if condition="$function.is_checked eq 1">checked</if>  tag="{$functionGroup.id}" disabled >
                    							<a href="{$function.path}" target="_blank" style="font-weight:normal;<if condition='$function.is_checked eq 1'>color:#FF0000;</if>"  title="{$function.path}" class="lbl"  >{$function.name}</a>
                    						</label>
                    					</foreach>
                    				</div>                            				
                    			</td>
                    		</tr>
                    	</foreach>                                                        
                    </tbody>
                </table>
			</div>			
		</div>
	</section>
</div>

<script type="text/javascript">
$(function(){
	$("#save-btn").click(function(){
		var id = $("#id").val();
		var name = $.trim($("#name").val());
		
		if(name == '') {
			ArtDialogHlp.showInfo('提示', '请填写用户组名');
            return false;
        }
		
		$.post('/admin/auth/saveUserGroup', {id:id, name:name}, function(data){
			if(data.Code == 999) {
				ArtDialogHlp.showInfo('提示', '操作成功', function(){
					window.location.href = '/admin/auth/userGroupList';
				});
			} else {
				ArtDialogHlp.showInfo('提示', data.Msg);
			}
		}, 'json');
	});
});
</script>